<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
		<style type="text/css" title="currentStyle">
			@import "/css/demo_page.css";
			@import "/css/demo_table.css";
		</style>
		<script type="text/javascript" language="javascript" src="/js/jquery.js"></script>
		<script type="text/javascript" language="javascript" src="/js/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#example').dataTable( {
					"sPaginationType": "full_numbers",
					"iDisplayLength": -1,
					"aLengthMenu": [[50,100,200, -1], [50, 100, 200, "All"]]
				});
			} );
		</script>
</head>

<body style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">
<form id="form1" name="form1" method="get" action="">
  <input type="text" name="part_code" id="part_code" />
  <input type="submit" name="button" id="button" value="Go" />
</form>

<br />
GI :Goods In (Wh receive) ,GO : Good Out (Shop Sale)  , TI:Transfer In (Wh to Shop) TO: Transfer Out (Shop to Wh)<br />
EI: Error Correction (Increase +), FO : Faulty Out (Descrease -)<br />
AI: Adjust In(+),AO: Adjust Out(-), AR: Adjust Result(Result Amount AFTER Adjust)
<br />
<br />

<div id="container">
<div id="demo">
<table width="800" border="0" cellspacing="1" cellpadding="5" class="display" id="example">
  <thead>
  <tr>
    <th bgcolor="#FFFFFF">Code</th>
    <th bgcolor="#FFFFFF">DateTime</th>
    <th bgcolor="#FFFFFF">Product</th>
    <th bgcolor="#FFFFFF">Move-Qty</th>
    <th bgcolor="#FFFFFF">Qty-After</th>
    <th bgcolor="#FFFFFF">Staff</th>
    <th bgcolor="#FFFFFF">Shop</th>
    <th bgcolor="#FFFFFF">Remark</th>
  </tr>
  </thead>
<?php
$rCode = new Model_DbTable_Pr_Prstockmovecode();
if(!empty($this->list)){
foreach($this->list as $k => $v){
	$row = $rCode->getCodeByID($v["code_move"]);
	if($row["code_move_code"]== 'AR'){
		$tm = strtotime($v['time_move']);
		$ts = $tm +1 ;
		$v["time_move"] = date('G:i:s',$ts);
	}
?>  
  <tr>
    <td bgcolor="#FFFFFF"><?php
    $row = $rCode->getCodeByID($v["code_move"]);
	echo $row["code_move_code"];
	?></td>
    <td bgcolor="#FFFFFF"><?=$v["date_move"]?> <?=$v["time_move"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["id_product"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["qty_product"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["qty_onhand"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["staff_name"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["shop_code"]?></td>
    <td bgcolor="#FFFFFF"><?=$v["id_job"]?></td>
  </tr>
<?php
}
}
?>
<tfoot>
  <tr>
    <th bgcolor="#FFFFFF">Code</th>
    <th bgcolor="#FFFFFF">DateTime</th>
    <th bgcolor="#FFFFFF">Product</th>
    <th bgcolor="#FFFFFF">Move-Qty</th>
    <th bgcolor="#FFFFFF">Qty-After</th>
    <th bgcolor="#FFFFFF">Staff</th>
    <th bgcolor="#FFFFFF">Shop</th>
    <th bgcolor="#FFFFFF">Remark</th>
  </tr>
</tfoot>  
</table>
</div>
</div>

</body>
</html>
